import type { App } from 'vue'
import vueClass,{Vue} from '@gowiny/vue-class'
import { useAppStore } from '@/store/modules/app';

const hooks = ['beforeRouteEnter','beforeRouteUpdate','beforeRouteLeave'];

Vue.registerHooks(hooks);
Vue.storeType = 'pinia';
Vue.defaultStore = useAppStore;

export const setupVueClass = (app: App<Element>) => {
    app.use(vueClass,{
        storeType:'pinia',//设定store类型位Pinia
        defaultStore:useAppStore,//设置默认的Store
        hooks:hooks
    });
}

export {
    Vue
};